package com.lzj.demo.design.singleton;

/**
 * 饿汉式模式
 * */
public class EasySingleton {
    //定义类的唯一实例,并立即初始化
    private static EasySingleton instance = new EasySingleton();
    //构造私有化
    private EasySingleton(){}
    //提供一个访问它的全局访问点
    public static EasySingleton getInstance() {
        return instance;
    }
}
